package com.yike.product.convert;

import com.yike.product.entity.Barcode;
import com.yike.product.vo.GoodsBarcodeApiVo;
import com.yike.product.vo.GoodsShopVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface BarcodeConvert {

    BarcodeConvert INSTANCE = Mappers.getMapper(BarcodeConvert.class);

    @Mapping(source = "code",target = "barcode")
    @Mapping(source = "goodsName",target = "name")
    @Mapping(source = "goodsImage",target = "image")
    @Mapping(source = "price",target = "buyPrice")
    GoodsShopVo convert(Barcode barcode);

    //@Mapping(source = "manuName",target = "manufacturerName")
    @Mapping(source = "manuAddress",target = "manufacturerAddress")
    //@Mapping(source = "spec",target = "specification")
    //@Mapping(source = "trademark",target = "brand")
    @Mapping(source = "img",target = "goodsImage")
    Barcode convert(GoodsBarcodeApiVo goodsBarcodeApiVo);

}
